<%--
违规处理页面，负责对违规记录进行处理。
@author <a href="mailto:chenfenghai@ceopen.cn">chenfenghai</a>
action ：renovationForwordAction
method ：initRenovateViolationHandle
created ：2010-09-28
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/messages.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/dateTime.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<title>违规处理</title>
<script>
var flagtip  = null;
function next(url){
	window.location.href = url;
}

function checkState(){
		if($('amerceYn').checked == true){
			$('amerceClient').disabled = '';
			$('amerceCompany').disabled = '';
		}
		else{
			$('amerceClient').disabled = 'disabled';
			$('amerceCompany').disabled = 'disabled';

		}


		if($('termReformYn').checked == true){
			$('reformDate').disabled = '';
			$('reformDateButton').disabled = '';
		}else{
			$('reformDate').disabled= 'disabled';
			$('reformDateButton').disabled = 'disabled';
		}


		if($('seizureYn').checked == true){
			$('seizureRes').disabled= '';
		}else{
			$('seizureRes').disabled= 'disabled';
		}


		if($('otherYn').checked == true){
			$('otherRemark').disabled= '';
		}else{
			$('otherRemark').disabled= 'disabled';
		}
	}

function violationHandle(){
	var isCheck = false;
	var inputArray = document.getElementsByTagName("input");
	var hasChecked = 0;
	for(var i=0; i < inputArray.length;i++){
		if(inputArray[i].type=='checkbox'){
			if(inputArray[i].checked) hasChecked++;
		}
	}
	if(hasChecked > 0){
		isCheck = true;
	}
	if(!isCheck){
		Validation.changeElmValidate("stopBehaviorYn","checkbox-min-1");
	}else{
		Validation.removeElmValidate("stopBehaviorYn","checkbox-min-1");
	}
	var isTrue=$('violationForm').fireEvent("onSubmit") ;
    if(isTrue && isCheck){
       var param = Form.serialize('violationForm');
       var url = "${ctx}/renovation_renovateViolationAction.do?method=handleRenovateViolation";
       new Ajax.Request(url,{method: 'post',parameters :param ,onSuccess : showResult});
	}
}
function showResult(response){
	ajaxSubmitException(response.responseText);
	findFrame("main").reloadRenovate();
	windowClose();
}
function init(){
	if(${violation.stopBehaviorYn} == "1"){
		$('stopBehaviorYn').checked = true;
	}
	if(${violation.stopRenovateYn} == "1"){
		$('stopRenovateYn').checked = true;
	}
	if(${violation.termReformYn} == "1"){
		$('termReformYn').checked = true;
	}
	if(${violation.amerceYn} == "1"){
		$('amerceYn').checked = true;
	}
	if(${violation.seizureYn} == "1"){
		$('seizureYn').checked = true;
	}
	if(${violation.otherYn} == "1"){
		$('otherYn').checked = true;
	}
}
</script>
</head>

<body onload="init();checkState();">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="window_head_outBg">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td><img src="${ctx}/images/ico_Advance.gif" width="16"
					height="16" align="absmiddle" /> <span class="window_head_intext">违规处理</span></td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="aux_header_line_1"></td>
	</tr>
	<tr>
		<td class="aux_header_line_2"></td>
	</tr>
	<tr>
		<td class="content">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td valign="top" class="aux_outtable_color">
				<form name="violationForm"
					action="${ctx}/renovation_renovateViolationAction.do?method=addRenovateViolation"
					method="post" class="required-validate"><input type="hidden"
					name="keyword" value="${violation.keyword }"> <input
					type="hidden" name="renovateLicenceId"
					value="${violation.renovateLicenceId }">
				<table width="100%" border="0" cellpadding="0" cellspacing="1"
					class="aux_intable_color">
					<tr>
						<td class="aux_intable_td1">房 号：</td>
						<td class="aux_intable_td2" id="houseNumber">${violation.houseNumber
						}&nbsp;</td>
						<td class="aux_intable_td1">业主姓名：</td>
						<td class="aux_intable_td2" id="owner">${violation.owner
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">装修许可证号：</td>
						<td class="aux_intable_td2" id="renovateLicenceNO">${violation.renovateLicenceNO
						}&nbsp;</td>
						<td class="aux_intable_td1">装修承建商：</td>
						<td class="aux_intable_td2" id="companyName">${violation.companyName
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">装修联系人：</td>
						<td class="aux_intable_td2" id="linkMan">${violation.linkMan
						}&nbsp;</td>
						<td class="aux_intable_td1">联系电话：</td>
						<td class="aux_intable_td2" id="linkManPhone">${violation.linkManPhone
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">现场负责人：</td>
						<td class="aux_intable_td2" id="burdenMan">${violation.burdenMan
						}&nbsp;</td>
						<td class="aux_intable_td1">联系电话：</td>
						<td class="aux_intable_td2" id="burdenManPhone">${violation.burdenManPhone
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">检查人：</td>
						<td class="aux_intable_td2" id="checkMan">${violation.checkMan
						}&nbsp;</td>
						<td class="aux_intable_td1">检查日期：</td>
						<td class="aux_intable_td2" id="checkDate">${violation.checkDate
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">责任部门：</td>
						<td class="aux_intable_td2" id="deptName">${violation.deptName
						}&nbsp;</td>
						<td class="aux_intable_td1">违规日期：</td>
						<td class="aux_intable_td2" id="violateDate">${violation.violateDate
						}&nbsp;</td>
					</tr>
					<tr>
						<td class="aux_intable_td1">违规类别：</td>
						<td class="aux_intable_td2" id="categoryName">${violation.categoryName
						}&nbsp;</td>
						<td class="aux_intable_td1">整改完成日期：</td>
						<td class="aux_intable_td2" id="completeDate">${violation.completeDate
						}&nbsp;</td>
					</tr>
					<tr>
						<td height="64" class="aux_intable_td1">违规行为描述：</td>
						<td colspan="3" class="aux_intable_td2"><textarea cols="60"
							rows="3" readonly="readonly">${violation.description }</textarea></td>
					</tr>
					<tbody id="handleResult">
						<tr>
							<td rowspan="6" valign="top" class="aux_intable_td1">处理结果：</td>
							<td colspan="3" class="aux_intable_require_more">
							<table border="0" cellspacing="2" cellpadding="2">
								<tr>
									<td>
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" name="stopBehaviorYn"
												value="1" afterInsert="rsAfter" /></td>
											<td width="4">&nbsp;</td>
											<td>请立即停止上述行为<span id="rsAfter"></span></td>
										</tr>
									</table>
									</td>
								</tr>
								<tr>
									<td colspan="3">
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" name="stopRenovateYn"
												value="1" /></td>
											<td width="4">&nbsp;</td>
											<td>请立即停止全部装修工程</td>
										</tr>
									</table>
									</td>
								</tr>
								<tr>
									<td colspan="3">
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" onclick="checkState();"
												name="termReformYn" value="1" /></td>
											<td width="4">&nbsp;</td>
											<td>期限于</td>
											<td width="4">&nbsp;</td>
											<td><input name="reformDate" type="text"
												class="inputtext validate-date-yyyy-mm-dd"
												value="<fmt:formatDate value="${violation.reformDate }" pattern="yyyy-MM-dd"/>"
												size="16" afterInsert="reformDateAfter" maxlength="10" /></td>
											<td width="4">&nbsp;</td>
											<td><a href="#"><img name="reformDateButton"
												src="${ctx}/images/ico_clock_month.gif" alt="请点选查找日期"
												border="0" /></a><span id="reformDateAfter"></span></td>
											<td width="4">&nbsp;</td>
											<td>恢复或处理好</td>
										</tr>
									</table>
									</td>
								</tr>
								<tr>
									<td colspan="3">
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" onclick="checkState();"
												name="amerceYn" value="1" /></td>
											<td width="4">&nbsp;</td>
											<td>罚款：业主</td>
											<td width="4">&nbsp;</td>
											<td><input name="amerceClient" type="text"
												class="float-zero-right integer-decimal-range-18-2"
												value="${violation.amerceClient }" style="text-align: right"
												size="16" maxlength="16" /></td>
											<td width="4">&nbsp;</td>
											<td>元(人民币)，装修公司</td>
											<td width="4">&nbsp;</td>
											<td><input name="amerceCompany" type="text"
												class="float-zero-right integer-decimal-range-18-2"
												value="${violation.amerceCompany }"
												style="text-align: right" size="16" maxlength="16" /></td>
											<td width="4">&nbsp;</td>
											<td>元(人民币)</td>
										</tr>
									</table>
									</td>
								</tr>
								<tr>
									<td colspan="3">
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" onclick="checkState();"
												name="seizureYn" value="1" /></td>
											<td width="4">&nbsp;</td>
											<td>没收</td>
											<td width="4">&nbsp;</td>
											<td><input name="seizureRes" type="text"
												value="${violation.seizureRes }" class="" size="26"
												maxlength="50" /></td>
										</tr>
									</table>
									</td>
								</tr>
								<tr>
									<td colspan="3">
									<table border="0" cellspacing="0" cellpadding="0">
										<tr>
											<td><input type="checkbox" onclick="checkState();"
												name="otherYn" value="1" /></td>
											<td width="4">&nbsp;</td>
											<td>其他</td>
											<td width="4">&nbsp;</td>
											<td><input name="otherRemark" type="text"
												value="${violation.otherRemark }" class="" size="26"
												maxlength="50" /></td>
										</tr>
									</table>
									</td>
								</tr>
								</tbody>
							</table>
							</form>
							</td>
						</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td class="window_footer">
		<table border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="buttonOffLeft" id="btn1_21"></td>
						<td class="buttonOffMiddle" id="btn1_22"
							onClick="violationHandle();" onMouseOver="btn_change_over(2)"
							onMouseOut="btn_change_out(2)" onblur="btn_change(2)"><img
							src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14"
							border="0" align="absbottom" /> 保 存</td>
						<td class="buttonOffRight" id="btn1_23"></td>
					</tr>
				</table>
				</td>
				<td class="btn_between_space"></td>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="buttonOffLeft" id="btn1_31"></td>
						<td class="buttonOffMiddle" id="btn1_32" onClick="windowClose();"
							onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)"
							onblur="btn_change(3)"><img
							src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14"
							border="0" align="absbottom" /> 关 闭</td>
						<td class="buttonOffRight" id="btn1_33"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
</table>
</body>
<script type="text/javascript">
              Calendar.setup(
              {
	              inputField : "violateDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "violateDateButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
               Calendar.setup(
              {
	              inputField : "checkDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "checkDateButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
               Calendar.setup(
              {
	              inputField : "reformDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "reformDateButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
</script>
</html>